package com.funfitnessapp;

import java.util.*;

public class CheckList {
    ArrayList<CheckItem> items;

    public CheckList() {
        items = new ArrayList<CheckItem>();
    }

    public void addItem(String title, String description, Date dateToFinish) {
        CheckItem item = new CheckItem();
        
        item.setTitle(title);
        item.setDescription(description);
        item.setDate(new Date());
        CheckItem tempItem = new CheckItem();
        item.setFinishDate(dateToFinish);

        items.add(item);
    }

    public CheckItem getItem(int num) {
        return items.get(num);
    }

    public CheckItem removeItem(int num) {
        return items.remove(num);
    }

    public int getNumItems() {
        return items.size();
    }

    public void setItemDone(int num) {
        items.get(num).closeItem();
    }

    private class CheckItem {
        boolean done;
        String title;
        String description;
        Date currentDate;
        Date dateToFinish;
        int priorityLevel;
        

        private CheckItem() {
            done = false;
            title = "";
        }

        private void closeItem() {
            done = true;
        }

        private boolean itemClosed() {
            return done;
        }

        private void setTitle(String newTitle) {
            title = newTitle;
        }

        private String getTitle() {
            return title;
        }

        private void setDescription(String newDescription) {
            description = newDescription;
        }

        private String getDescription() {
            return description;
        }

        private void setDate(Date newDate) {
            currentDate = newDate;
        }

        private Date getDate() {
            return currentDate;
        }

        private void setFinishDate(Date newFinishDate) {
            dateToFinish = newFinishDate;
        }

        private Date getFinishDate() {
            return dateToFinish;
        }

        private void setPriority(int newPriority) {
            priorityLevel = newPriority;
        }

        private int getPriority() {
            return priorityLevel;
        }
    }
}